package com.fzb.zrlog.simple.controller;

import com.hibegin.http.server.api.HttpRequest;
import com.hibegin.http.server.api.HttpResponse;

import java.util.HashMap;
import java.util.Map;

public abstract class ManageControl extends BaseControl {
    private Map<String, Object> data = new HashMap<String, Object>();

    public ManageControl(HttpRequest request, HttpResponse response) {
        super(request, response);
    }

    public Map<String, Object> getData() {
        return this.data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public void oper() {
        // 清空数据缓存
        BaseControl.refreshCache();
    }

    public void put(String key, Object value) {
        data.put(key, value);
    }

    public abstract void add();

    public abstract void update();

    public abstract void delete();

    public abstract void queryAll();

}
